import App from './App'

// 导入pinia
import * as Pinia from 'pinia'
import { createUnistorage } from "./uni_modules/pinia-plugin-unistorage";
import uvUI from '@/uni_modules/uv-ui-tools'
import VConsole from 'vconsole'

// 仅在开发环境中初始化vConsole
// if (process.env.NODE_ENV === 'development') {
//     new VConsole()
// }

import {
    createSSRApp
} from 'vue'
export function createApp() {
    const app = createSSRApp(App)

    // 创建pinia实例
    const pinia = Pinia.createPinia()
    // 关键代码 👇
    pinia.use(createUnistorage());
    // 使用pinia
    app.use(pinia)

    app.use(uvUI);
    return {
        app,
        Pinia
    }
}